import React, { Component } from 'react'
import Counter from './Counter';
/*
  触发render调用有三种情况
  1、setState()就会被调用
  2、New props也可以调用render
  3、调用forceUpdate
*/
export default class App extends Component {
  state={
    num:0
  }

  render() {
    console.log('------父组件的render-----------');
    return (
      <div>
         <Counter number={this.state.num}></Counter>
         <button onClick={()=>this.forceUpdate()}>改变</button>
      </div>
    )
  }
}
